package com.google.gwt.chart.client;

import com.google.gwt.widgetideas.graphics.client.*;
import java.util.ArrayList;

//=========================================================================
/**
 * Title:        GlotrData <br>
 * Description:  $defaultDesc$<br>
 * Copyright:    Apache Public License 2.0<br>
 * Company:      $company$<br>
 * @author James Hutton
 */
//=========================================================================
public class GlotrData {

	/** Field: color          */
	public Color color;
	/** Field: data          */
	public ArrayList<Coordinate> data;
	/** Field: label          */
	public String label;
	/** Field: lines          */
	public PlotOptions.LinesOptions lines;
	/** Field: mouse          */
	public PlotOptions.MouseOptions mouse;
	/** Field: bars          */
	public PlotOptions.BarOptions bars;
	/** Field: points          */
	public PlotOptions.PointsOptions points;
	public PlotOptions.PieOptions pie;
	/** Field: shadowSize          */
	public Number shadowSize = null;

	//=========================================================================
	/**
	 * Constructs a GlotrData
	 */
	//=========================================================================
	public GlotrData() {

		color = Color.BLACK;
		label = "";
		lines = new PlotOptions.LinesOptions();
		mouse = new PlotOptions.MouseOptions();
		bars = new PlotOptions.BarOptions();
		points = new PlotOptions.PointsOptions();
		shadowSize = PlotOptions.DEFAULT_SHADOWSIZE;
		data = new ArrayList<Coordinate>();
		pie = new PlotOptions.PieOptions();
	}

	//=========================================================================
	/**
	 * Method getData
	 * @return ArrayList<Coordinate>
	 */
	//=========================================================================
	public ArrayList<Coordinate> getData() {
		return data;
	}
	
	public Double getXSum(){
		Double ret = new Double(0);
		for(int i=0;i<data.size();i++){
			ret+=data.get(i).x;
		}
		return ret;
	}
	
}

